import { Channel } from '@/types/data'

const CHANNEL_KEY = 'geek-app-channel-68'
/**
 * 保存频道数据
 * @param channels
 */
export function setChannels (channels: Channel[]): void {
  localStorage.setItem(CHANNEL_KEY, JSON.stringify(channels))
}

/**
 * 获取频道列表数据
 * @returns
 */
export function getChannels (): Channel[] {
  return JSON.parse(localStorage.getItem(CHANNEL_KEY) || '[]')
}
